Skip to content

NDIS: Harden QoS bytes calculation in netvmini control path#1386

Merged
5an7y-Microsoft merged 2 commits into
microsoft:mainfrom
andremueiot:user/andremueiot/multiplication_converted_to_larger_type
May 21, 2026
Merged

NDIS: Harden QoS bytes calculation in netvmini control path#1386
5an7y-Microsoft merged 2 commits into
microsoft:mainfrom
andremueiot:user/andremueiot/multiplication_converted_to_larger_type

Conversation

@andremueiot
Copy link
Copy Markdown

This fixes:
CodeQL Scanning Alert in network/ndis/netvmini/6x/ctrlpath.c - Multiplication result converted to larger type

Summary:

  • Replaced direct size arithmetic in NICSetQOSParameters with checked integer-safe operations.
  • Added overflow handling for classification table size computation:
  • Multiply NumClassificationElements × ClassificationElementSize via RtlULongMult.
  • Add the revision header size via RtlULongAdd.
  • Return NDIS_STATUS_INVALID_LENGTH when either checked operation fails, instead of relying on unchecked arithmetic.

- Replaced direct size arithmetic in NICSetQOSParameters with checked integer-safe operations.
- Added overflow handling for classification table size computation:
- Multiply NumClassificationElements × ClassificationElementSize via RtlULongMult.
- Add the revision header size via RtlULongAdd.
- Return NDIS_STATUS_INVALID_LENGTH when either checked operation fails, instead of relying on unchecked arithmetic.
@andremueiot andremueiot requested a review from a team as a code owner May 20, 2026 17:57
@5an7y-Microsoft 5an7y-Microsoft merged commit c7ad9e8 into microsoft:main May 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants